package com.mushuilingfeng.ddd.framework.factory;

import com.mushuilingfeng.ddd.framework.ComponentFactoryHolder;

import java.util.List;

/**
 * 组件工厂
 *
 * @author mushuilingfeng
 * @date 2024/9/29
 */
public class ComponentFactory {
    private ComponentFactory() {
    }

    public static <T> T getComponent(Class<T> clazz) {
        return ComponentFactoryHolder.getComponentFactory().getComponent(clazz);
    }

    public static <T> List<T> getComponentList(Class<T> clazz) {
        return ComponentFactoryHolder.getComponentFactory().getComponentList(clazz);
    }
}
